package io.github.talelin.sleeve.common.exception;

import io.github.talelin.sleeve.common.api.Code;
import org.springframework.http.HttpStatus;

public class FileTooManyException extends HttpException {
    private static final long serialVersionUID = -3189291002817434249L;
    protected int code;
    protected int httpCode;

    public FileTooManyException() {
        super(Code.FILE_TOO_MANY.getDescription(), Code.FILE_TOO_MANY.getCode());
        this.code = Code.FILE_TOO_MANY.getCode();
        this.httpCode = HttpStatus.PAYLOAD_TOO_LARGE.value();
    }

    public FileTooManyException(String message) {
        super(message);
        this.code = Code.FILE_TOO_MANY.getCode();
        this.httpCode = HttpStatus.PAYLOAD_TOO_LARGE.value();
    }

    public FileTooManyException(int code) {
        super(Code.FILE_TOO_MANY.getDescription(), code);
        this.code = Code.FILE_TOO_MANY.getCode();
        this.httpCode = HttpStatus.PAYLOAD_TOO_LARGE.value();
        this.code = code;
    }

    public FileTooManyException(String message, int code) {
        super(message, code);
        this.code = Code.FILE_TOO_MANY.getCode();
        this.httpCode = HttpStatus.PAYLOAD_TOO_LARGE.value();
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

    public int getHttpCode() {
        return this.httpCode;
    }
}

